//
//  PointClassTableViewCell2.m
//  fitnessmanage
//
//  Created by wujian on 2018/1/22.
//  Copyright © 2018年 zongquankeji. All rights reserved.
//

#import "PointClassTableViewCell2.h"

@implementation PointClassTableViewCell2

-(id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
    
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    
    if (self) {
        
        /**
         教练名字
         */
        UILabel *coachLineLabel = [[UILabel alloc] init];
        coachLineLabel.backgroundColor = ButtonBackGroundColor;
        [self.contentView addSubview:coachLineLabel];
        self.coachLineLabel = coachLineLabel;
                
        /**
         教练名字
         */
        UILabel *coachNameLabel = [[UILabel alloc] init];
        coachNameLabel.font = TitleBoldFont;
        coachNameLabel.text = @"教练";
        [self.contentView addSubview:coachNameLabel];
        self.coachNameLabel = coachNameLabel;
        
        /**
         头像图片
         */
        UIImageView *headImageView = [[UIImageView alloc] init];
        headImageView.contentMode = UIViewContentModeScaleAspectFill;
        headImageView.backgroundColor = CSRedColor;
        headImageView.layer.cornerRadius = 30;
        headImageView.layer.masksToBounds = YES;
        [self.contentView addSubview:headImageView];
        self.headImageView = headImageView;
        
        /**
         标题
         */
        UILabel *titleLabel = [[UILabel alloc] init];
        titleLabel.font = [UIFont boldSystemFontOfSize:16];
        titleLabel.text = @"阿金";
        [self.contentView addSubview:titleLabel];
        self.titleLabel = titleLabel;
        
        [self setConstraints];
    }
    
    return self;
}

-(void)setConstraints{
    
    /**
     教练名字
     */
    [self.coachLineLabel mas_remakeConstraints:^(MASConstraintMaker *make) {
        
        make.top.mas_equalTo(self.contentView).offset(10);
        
        make.left.mas_equalTo(self.contentView).offset(13);
        
        make.width.mas_equalTo(3);
        
        make.height.mas_equalTo(self.coachNameLabel);
    }];
    
    
    /**
     教练名字
     */
    [self.coachNameLabel mas_remakeConstraints:^(MASConstraintMaker *make) {
        
        make.top.mas_equalTo(self.contentView).offset(10);
        
        make.left.mas_equalTo(self.coachLineLabel.mas_right).offset(7);
        
    }];
    
    /**
     头像图片
     */
    [self.headImageView mas_remakeConstraints:^(MASConstraintMaker *make) {
        
        make.top.mas_equalTo(self.coachNameLabel.mas_bottom).offset(20);
        
        make.width.height.mas_equalTo(60);
        
        make.left.mas_equalTo(self.contentView).offset(40);
    }];
    
    /**
     标题
     */
    [self.titleLabel mas_remakeConstraints:^(MASConstraintMaker *make) {
        
        make.top.mas_equalTo(self.headImageView.mas_bottom).offset(10);
        
        make.centerX.mas_equalTo(self.headImageView);
        
        make.bottom.mas_equalTo(self.contentView).offset(-30);
    }];
}

@end
